﻿Imports DevExpress.XtraEditors

Public Class FormDoi_DG

    Private Sub ThuBindingNavigatorSaveItem_Click(sender As System.Object, e As System.EventArgs) Handles ThuBindingNavigatorSaveItem.Click
        Me.Validate()
        Me.ThuBindingSource.EndEdit()
        Me.TableAdapterManager.UpdateAll(Me.PcvgppDataSet)

    End Sub

    Private Sub FormDoi_DG_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
        'TODO: This line of code loads data into the 'PcvgppDataSet.khachhang' table. You can move, or remove it, as needed.
        Me.KhachhangTableAdapter.Fill(Me.PcvgppDataSet.khachhang)
        'TODO: This line of code loads data into the 'PcvgppDataSet.thuchitiet' table. You can move, or remove it, as needed.
        Me.ThuchitietTableAdapter.Fill(Me.PcvgppDataSet.thuchitiet)
        'TODO: This line of code loads data into the 'PcvgppDataSet.thu' table. You can move, or remove it, as needed.
        Me.ThuTableAdapter.Fill(Me.PcvgppDataSet.thu)
        Me.GridView1.IndicatorWidth = 50
        Me.GridView1.OptionsNavigation.EnterMoveNextColumn = True
    End Sub

    Private Sub GridView1_CustomDrawRowIndicator(sender As Object, e As DevExpress.XtraGrid.Views.Grid.RowIndicatorCustomDrawEventArgs) Handles GridView1.CustomDrawRowIndicator

        Dim indicatorIcon As Boolean = False
        If e.RowHandle >= 0 Then 'trừ trường hợp -1
            'Check whether the indicator cell belongs to a data row
            If e.Info.IsRowIndicator Then
                e.Info.DisplayText = (e.RowHandle + 1).ToString()
                If Not indicatorIcon Then
                    e.Info.ImageIndex = -1
                End If
            End If
        End If
    End Sub

    Private Sub DonviTextEdit_GotFocus(sender As Object, e As System.EventArgs) Handles DonviTextEdit.GotFocus
        Me.DonviTextEdit.ShowPopup()
    End Sub

    Private Sub GridView1_ShownEditor(sender As Object, e As System.EventArgs) Handles GridView1.ShownEditor
        If TypeOf GridView1.ActiveEditor Is SearchLookUpEdit Then
            DirectCast(GridView1.ActiveEditor, SearchLookUpEdit).ShowPopup()
        End If
    End Sub
End Class